package com.fujica.invoicing.service.impl;

import com.fujica.invoicing.service.ICookieService;
import com.fujica.invoicing.utils.Result;
import com.fujica.invoicing.utils.ResultBody;
import org.springframework.stereotype.Service;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;

/**
 * @ClassName CookieServiceImpl
 * @Description TODO
 * @Author admin
 * @Date 2020/8/15 14:22
 * @Version 1.0
 **/


@Service
public class CookieServiceImpl implements ICookieService {

    // 生成cookie
    @Override
    public Result generateCookie(Integer eId, HttpServletResponse response) {
        Cookie cookie = new Cookie("userId", eId.toString());
        response.addCookie(cookie);
        return ResultBody.ok();
    }
}
